﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class contact : System.Web.UI.Page
{
    EmailManager em= new EmailManager();

    protected void Page_Load(object sender, EventArgs e)
    {

        if (IsPostBack)
        {
            //lblName.Text = txtName.Text;
            //txtName.Text = "";
        }
    }
    protected void btnSubtit_Click(object sender, EventArgs e)
    {
        System.Collections.Specialized.ListDictionary replacements = new System.Collections.Specialized.ListDictionary();
        replacements.Add("<%To%>", "debioscoop@vdlmark.com");
        replacements.Add("<%From%>", "debioscoop@vdlmark.com");
        string message = txtMessage.Text.Replace(" ", "&nbsp;").Replace(System.Environment.NewLine, "<br />");

        try
        {
            em.sendEmail("debioscoop@vdlmark.com", txtSubject.Text, replacements, message + "<br /><br />Afzender is: <br />Naam:" + txtName.Text + "<br />Email:" + txtEmail.Text);
        }
        catch (Exception ex)
        {
            lblName.Text = ex.ToString();
        }
    }
    
}